/*
 * Copyright (c) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import '../hadss_knock_share.dart';

class SharedRecord {
  // Indicates the uniform type descriptor of shared record,
  // for details,see {@link @ohos.data.uniformTypeDescriptor}.
  String utd = "";

  // Indicates the content of shared record, information that does not
  // require authorization, including but not limited to text, HTML text, and URL.
  String? content;

  // Indicates the uri of shared record.
  String? uri;

  // Indicates the title of shared record
  String? title;

  // Indicates the label of shared record
  String? label;

  // Indicates the description of shared record
  String? description;

  // Indicates the thumbnail of shared record
  dynamic thumbnail;

  // Indicates the thumbnail uri of shared record
  String? thumbnailUri;

  // Indicates the extra data of shared record. The content
  // is forwarded to the target application without permission authorization.
  // extraData?: Record<string, string | number | boolean | Array<string | number | boolean>>;
  Map<String, dynamic>? extraData;

  SharedRecord(UniformDataType uniformDataType) {
    utd = uniformDataType.value;
  }

  Map<String, dynamic> toJson() =>
      {
        "utd": utd,
        "content": content,
        "uri": uri,
        "title": title,
        "label": label,
        "description": description,
        "thumbnail": thumbnail,
        "thumbnailUri": thumbnailUri,
        "extraData": extraData,
      };
}